<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>专业用工详情</title>
    <link rel="stylesheet" type="text/css" href="../../css/aui/aui.css" />
    <style>
        #particulars .aui-list {
            background-image: none;
        }

        #particulars .aui-list .aui-list-item {
            padding-left: 0;
            margin: .5rem .75rem 0;
        }

        #particulars .aui-list .aui-list-item:last-child {
            background: rgba(0, 0, 0, 0);
        }

        #particulars .aui-list .aui-list-item-inner {
            align-items: flex-end;
            -webkit-align-items: flex-end;
            padding-right: 0.3rem;
        }

        #particulars .aui-list .aui-list-item-right {
            color: #0689FB;
            max-width: 100%;
            font-size: 0.75rem;
        }

        #particulars .aui-list.aui-list-in .aui-list-item {
            background-position: 0 bottom;
        }

        #particulars .no-rim {
            background-image: none;
        }

        #details {
            margin: 0 .75rem;
        }

        #details .details_list_item {
            margin-top: 1rem;
        }

        #details .column_h {
            border-left: 0.2rem solid #0689FB;
            padding-left: 0.4rem;
            font-size: .9rem;
        }

        #details .content {
            color: #2C2C2C;
            margin-top: .5rem;
            margin-bottom: .2rem;
            font-size: 0.8rem;
        }

        .flex-row {
            display: flex;
            justify-content: space-between;
        }

        .pic-item {
            margin-right: 0.5rem;
        }

        .pic-item:last-child {
            margin-right: 0.5rem;
        }
    </style>
</head>

<body>
    <div id="app" style="padding-bottom:1rem;">
        <div class="aui-content" id="particulars">
            <ul class="aui-list aui-list-in">
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-title">项目名称</div>
                        <div class="aui-list-item-right">{{info.title}}</div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-title">用工地点</div>
                        <div class="aui-list-item-right">{{info.region}}</div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-title">详细地址</div>
                        <div class="aui-list-item-right">{{info.address}}</div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-title">用工时间</div>
                        <div class="aui-list-item-right">{{info.work_date}}</div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-title">金额预算</div>
                        <div class="aui-list-item-right"><span v-if="info.reward>0">{{info.reward}}</span><span v-else>面议</span></div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-title">项目性质</div>
                        <div class="aui-list-item-right"><span v-if="info.work_nature===1">承包制</span><span v-else>聘用制</span></div>
                    </div>
                </li>
            </ul>
            <ul class="aui-list aui-list-in" style="border-top:0.5rem solid #F6F6F6;border-bottom:0.5rem solid #F6F6F6;">
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-title">联系人</div>
                        <div class="aui-list-item-right">{{info.contact}}</div>
                    </div>
                </li>
                <li class="aui-list-item" v-show="isMobile" @click.stop="call(info.contact_phone)">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-title">联系人电话</div>
                        <div class="aui-list-item-right">{{info.contact_phone}}</div>
                    </div>
                </li>
            </ul>
        </div>
        <div class="aui-content" id="details">
            <div class="details_list_item">
                <div class="column_h">项目介绍</div>
                <p class="content">{{info.work_summary}}</p>
                <div class="flex-row">
                    <div class="pic-item" v-for="item in info.work_image_array"><img :src="item" alt=""></div>
                </div>
            </div>
            <div class="details_list_item">
                <div class="column_h">其他要求</div>
                <p class="content">{{info.other_notes}}</p>
            </div>
        </div>
    </div>
</body>
<script src="../../script/api.js" charset="utf-8"></script>
<script src="../../script/common/jquery-3.3.1.min.js" charset="utf-8"></script>
<script src="../../script/common/common.js" charset="utf-8"></script>
<script src="../../script/common/config.js" charset="utf-8"></script>
<script src="../../script/common/vue.min.js" charset="utf-8"></script>
<script>
    apiready = function() {
        api.parseTapmode();
        vm.init();
    }

    var vm = new Vue({
        el: "#app",
        data: {
            isMobile: true,
            info: {}
        },
        methods: {
            init() {
                console.log(api.pageParam.id);
                this.isMobile = api.pageParam.isMobile;
                this.getInfo();
            },
            getInfo() {
                var that = this;
                var userInfo = get_local("userInfo");
                var data = {
                    user_id: userInfo.user_id,
                    work_id: api.pageParam.id
                };
                _ajax(Config.api.SpecialtyGetDetail, data, function(ret) {
                    if (ret.code === 200) {
                        that.info = ret.data;
                    }
                });
            },
            call(phone) {
                api.call({
                    type: 'tel_prompt',
                    number: phone
                });
            }
        }
    });
</script>

</html>
